local shengen = fk.CreateSkill{
    name = "XD__shengen"
}
Fk:loadTranslationTable{
    ["XD__shengen"] = "圣恩",
    [":XD__shengen"] = "你可以跳过摸牌阶段，令所有其他角色各摸一张牌，然后所有其他角色选择一项：交给你一张牌，或令你弃置其区域内一张牌。",
    ["#XD__shengen"] = "圣恩：是否跳过摸牌阶段，令所有其他角色各摸一张牌？",
    ["#XD__shengen-give"] = "圣恩：交给 %dest 一张牌，或点“取消”令其弃置你区域内一张牌",
}

shengen:addEffect(fk.EventPhaseChanging, {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(shengen.name) and
        data.phase == Player.Draw and not data.skipped
    end,
    on_cost = function (self, event, target, player, data)
        return player.room:askToSkillInvoke(player, {
        skill_name = shengen.name,
        prompt = "#XD__shengen",
        })
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        data.skipped = true
        for _, cp in ipairs(room:getOtherPlayers(player)) do
            cp:drawCards(1, shengen.name)
        end
        for _, cp in ipairs(room:getOtherPlayers(player)) do
            local cards = room:askToCards(cp, {
                skill_name = shengen.name,
                pattern = ".",
                max_num = 1,
                min_num = 1,
                prompt = "#XD__shengen-give::"..player.id,
            })
            if #cards > 0 then
                room:obtainCard(player, cards, false, fk.ReasonGive, cp, shengen.name)
            else
                local id = room:askToChooseCard(player, {
                    target = cp,
                    flag = "hej",
                    skill_name = shengen.name,
                })
                room:throwCard(id, shengen.name, cp, player)
            end
        end
    end
})

return shengen